import { MyRequest } from "./api";

// 检测注册状态
export function testInfo() {
  return new Promise((resolve, reject) => {
    let openid;
    uni.getStorage({
      key: "openid",
      success: (data) => {
        openid = data.data;
        MyRequest({
          url: "/test_openid",
          method: "POST",
          data: {
            openid: openid,
          },
        }).then((res) => {
          resolve(res.data.mesg);
        });
      },
      fail: (error) => {
        console.log(error);
        reject(error);
      },
    });
  });
}
